import { ElLoading } from 'element-plus'

let globalLoading = null

export const showLoading = (options = {
    text: 'Loading, please wait...'
}) => {
    globalLoading = ElLoading.service({
        fullscreen: true,
        ...options
    })
}

export const hideLoading = () => {
    globalLoading && globalLoading.close()
}